/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package towerdefence.model.blocks;

import net.phys2d.raw.Body;
import towerdefence.model.*;
import net.phys2d.math.Vector2f;
import net.phys2d.raw.shapes.Box;

/**
 *
 * @author Gussoh
 */
public class StyrofoamBlock extends Block {

    private float width, height;
    
    public StyrofoamBlock(Vector2f position, float width, float height) {
        super(
                new Box(width, height),
                width * height * .1f,
                position
            );
        setFriction(0.9f);
        
        this.width = width;
        this.height = height;
    }

    @Override
    public double getStrength() {
        return Math.min(width, height) * getMass() * 1000;
    }

    @Override
    public void destroyedBy(Body other, double forceSquared) {
        System.out.println(this + " was DESTORYED by " + other + " force was: sqrt(" + forceSquared + ")");
    }
}
